Week 9

Week 9: Output Devices

November 10 - 17


[0] Overview
This week's assignments:
(1.) Add an output device to a microcontroller board you've designed and program it to do something
2.) Measure the power consumption of an output device

For my final project, I plan on including a variety of output devices, mainly a LCD/OLED display as well as 4 stepper motors (wiring this up will be fun...). For the purpose of output week, I'll focus on the stepper motor with a commercial driver.


[1] Group Assignment
The assignment was to test the power consumption of an output device. I specifically tested a NEMA 17 stepper motor using the oscilloscope, which gave a current of 1.7A when I powered it with 9.3V. The power can simply be calculated thorugh the fomula P = I*V = 15.81 W.

This is a good reference point to have for the stepper motor drivers: the A4988 and the DVR each have a potentiometer that needs to be adjusted to this particular stepper motor, or else I risk pulling too much power and ruining the board and the microprocessor. For the DVR breakout boards that Zach has on his website, I would need to find the VRef, which would be the current divided by half for a rough estimate. This should work for the final project, and I will be testing it out shortly.

[2] KICAD
Using KiCAD, the first item that I made was using the ATMEGA 238 SMD, which is on the lower scale of processing but still is one of the easier chips to program. First, you need to bootload it, but afterwards it works similarly to a typical Arduino UNO R3 chip.

This was my second iteration, and I realized something a bit too late on my first one for input week; I didn't actually inlcude the bootloading pinouts on the botom of the board. These would have connected up to a working board, and using the built-in functionality I could have easily bootloaded it. One of the benefits of the ATMEGA versus the ATTINY is the increased amount of pins that are avaiable to use for me, especially now that I have around 20 pins instead of 6 - 10. My original plan had all my stepper motors on one processor, and the ATMEGA should have enough to do so if I continue with this path - my only fear is the timing circuits of both the left and right z axis stepper motors would be affected slightly and cause it to tilt, though I discussed this with the TFs and they mentioned that it would be fine. I also want to mention that it would have been better to stick with just one type of chip at the beginning, so that any mistakes you make on the first one are fixed and that you can learn a lot more of the chip limitations/features by sticking with it for a couple week. It's still a nice experience to experiment with the different methods of how you flash different chips, and it really depends on the unique architectures that they are built off of.

[3] Milling



I'd say that I'm getting a lot better with these milled boards. Apart from the dust stuck in the bottom right corner, I think it's pretty clean without any sanding. Right now, I'm following Pololu's tutorial on their website while looking at their datasheet.

[4] Attaching the Driver and Testing




For these stepper motors, I've been using the accelTest library, but I've also been experimenting with just the number of steps themselves without a library (after all, the way a stepper motor moves is because of quick pulses sent to the motor). I'd have been more excited about this working if there wasn't the fact that we could make our own stepper motor drivers (and if my motor maybe didn't burn the driver after ten seconds before getting a video... Quick tip: Make sure you set the correct resistance AND have a diode for protection)! Stay tuned for that as I will update it in the final documentation.